home *** CD-ROM | disk | FTP | other *** search
/ Practical Algorithms for Image Analysis / Practical Algorithms for Image Analysis.iso / LIBIP / LLDEF.H < prev    next >
C/C++ Source or Header  |  1999-09-11  |  2KB  |  82 lines

  1. /* 
  2.  * lldef.h
  3.  * 
  4.  * Practical Algorithms for Image Analysis
  5.  * 
  6.  * Copyright (c) 1997, 1998, 1999 MLMSoftwareGroup, LLC
  7.  */
  8.  
  9. /*
  10.  * LLDEF.H
  11.  *
  12.  * header file for doubly linked list manipulation functions in llist.c
  13.  *
  14.  * ref: 
  15.  *   R. Sessions
  16.  *   "Reusable Data Structures For C"
  17.  *   Prentice Hall, Englewood Cliffs, NJ, 1989;
  18.  */
  19.  
  20. #ifndef _LLDEF_H_
  21. #define    _LLDEF_H_
  22.  
  23.  
  24. typedef enum {
  25.   False = 0, True = 1,
  26.   InActive = 0, Active = 1,
  27.   UnSet = 0, Set = 1,
  28.   Fail = 0, Pass = 1,
  29.   UnMatched = 0, Matched = 1,
  30.   Accept = 0, Reject = 1,
  31.   Forward = 0, Reverse = 1, UnKnown = -1
  32. } Boolean;
  33.  
  34. /*
  35.  * structure of each link (node) in a given list
  36.  */
  37. struct linktype {
  38.   struct linktype *next;
  39.   struct linktype *previous;
  40.   char *item;                   /* ptr to struct itemtype will be */
  41.   /* mapped onto this ptr to char!! */
  42. };
  43.  
  44.  
  45. /*
  46.  * parameters characterizing active list
  47.  * (several lists may be handled; see Sessions, sect 5.3)
  48.  */
  49. struct linklist {
  50.   struct linktype *head;        /* pointers for active list */
  51.   struct linktype *tail;
  52.   struct linktype *clp;
  53.  
  54.   int listlength;
  55.   int itemlength;
  56.  
  57.   int (*match) ();              /* func ptr to matching function */
  58. };
  59.  
  60.  
  61.  
  62. /* function prototypes (in llist.c) */
  63. static struct linktype *llcrlink (struct linklist *list);
  64. extern void llsetmatch (int (*numatch) (), struct linklist *list);
  65. extern void llsetsize (int size, struct linklist *list);
  66. extern void moveitem (char *src_addr, char *dest_addr, int length);
  67. extern void llzero (struct linklist *list);
  68. extern void llinit (char *newitem, struct linklist *list);
  69. extern void llhead (struct linklist *list);
  70. extern void lltail (struct linklist *list);
  71. extern Boolean llnext (struct linklist *list);
  72. extern Boolean llprevious (struct linklist *list);
  73. extern Boolean llsearch (char *desired_item, struct linklist *list);
  74. extern void llretrieve (char *newitem, struct linklist *list);
  75. extern void lladd (char *newitem, struct linklist *list);
  76. extern void lladdhead (char *newitem, struct linklist *list);
  77. extern void lladdprev (char *newitem, struct linklist *list);
  78. extern void lldelete (struct linklist *list);
  79. extern int ll_length (struct linklist *list);
  80.  
  81. #endif /* _LLDEF_H_ */
  82.